package cn.znzz.cjm.service.impl;

import cn.znzz.cjm.domain.CourseDictionary;
import cn.znzz.cjm.mapper.CourseDictionaryMapper;
import cn.znzz.cjm.service.ICourseDictionaryService;
import cn.znzz.cjm.util.AjaxResult;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author chenjiangmin
 * @since 2021-12-22
 */
@Service
public class CourseDictionaryServiceImpl extends ServiceImpl<CourseDictionaryMapper, CourseDictionary> implements ICourseDictionaryService {

    @Autowired
    private CourseDictionaryMapper courseDictionaryMapper;
    @Override
    public AjaxResult findCourseLevel(String type) {
        Wrapper<CourseDictionary> wrapper = new EntityWrapper<CourseDictionary>().eq("type", type);
        List<CourseDictionary> list = courseDictionaryMapper.selectList(wrapper);
        return AjaxResult.me().setResultObj(list);
    }
}
